package RecursionAndIteration;

import org.junit.Test;

public class Recursion {
	/**
	 * Fibonacci数列
	 * 无穷数列 1,1,2,3,5,8,13,......称为Fibonacci数列
	 */
	@Test 
	public void fun() {
		System.out.println(fibonacci(3));
	}
	public int fibonacci(int n) {
		if(n == 1 || n == 2) return 1;
		return fibonacci(n - 1) + fibonacci(n - 2);
	}
}
